<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header"></head>

<body class="hold-transition skin-blue sidebar-mini">
<section class="content">
    <div class="row" style="margin-bottom: 24px">
        <button class="btn btn-info pull-right" onclick="Print('#print')">打印</button>
    </div>
    <form id="sheetForm" class="form-horizontal">
        <di id="print">
            <div class="row">
                <div class="col-xs-11" style="margin-left: 4%;">
                    <table class="t1">
                        <thead>
                        <tr>
                            <td colspan="9">
                                <img th:src="@{/img/logo3.jpg}" width="64px" height="40px" style="margin-top: -20px">
                                <div style="display: inline-block;margin-top: 5px;margin-left: 20px">
                                    <span style="letter-spacing: 24px;display: block;line-height: 20px">&nbsp;辽宁忠旺机械设备制造有限公司</span>
                                    <span style="display: block;font-size: 12px;line-height: 20px">Liaoning Zhongwang Machinery Equipment Manufacturing Co., Ltd</span>
                                </div>
                            </td>
                            <td colspan="2">装配派工单</td>
                            <td rowspan="4" style="width: 8.5%">
                                <div id="qrCode-div" style="display: none"></div>
                                <img id="qr-img" width="100px" height="100px">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 6%">生产令号</td>
                            <td style="width: 11%">
                                [[${asse.prodNo}]]
                            </td>
                            <td style="width: 7.3%">项目名称</td>
                            <td colspan="2">
                                [[${asse.proName}]]
                            </td>
                            <td style="width: 6%">订单数量</td>
                            <td style="width: 7%">
                                [[${asse.proNum}]]
                            </td>
                            <td style="width: 9.1%">类型</td>
                            <td style="width: 6.9%">
                                [[${asse.special}]]
                            </td>
                            <td style="width: 7.9%">部分</td>
                            <td style="width: 9.8%">
                                [[${asse.part}]]
                            </td>
                        </tr>
                        <tr>
                            <td rowspan="2">装配图号</td>
                            <td colspan="2" rowspan="2">
                                [[${asse.drawNo}]]
                            </td>
                            <td rowspan="2" style="width: 6%">装配名称</td>
                            <td colspan="3" rowspan="2">
                                [[${asse.drawName}]]
                            </td>
                            <td rowspan="2">装配数量</td>
                            <td rowspan="2">
                                [[${asse.drawNum}]]
                            </td>
                            <td>要求完成时间</td>
                            <td>
                                [[${asse.compTime}]]
                            </td>
                        </tr>
                        <tr>
                            <td>部门</td>
                            <td>
                                [[${asse.deptName}]]
                            </td>
                        </tr>
                        </thead>
                        <tbody id="card">
                        <tr>
                            <td>注<br>意<br>事<br>项</td>
                            <td colspan="11" style="text-align:left;padding-left: 5px;height: 400px;">
                                <div th:utext="${asse.remark}"></div>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div class="col-xs-11" style="font-size: 14px;line-height: 200%;margin-left: 4%;">
                    <div class="col-xs-3" style="padding-left: 0">提报人： [[${asse.createName}]]&nbsp;&nbsp;[[${#dates.format(asse.createTime,'yyyy.MM.dd')}]]</div>
                    <div class="col-xs-3 bottom form-inline">联系电话：[[${asse.createTel}]]</div>
                </div>
            </div>
        </di>
    </form>
    <br>
    <hr>
    <div class="row">
        <div class="col-xs-12" style="margin-left: 4%;padding-right: 9%;">
            <h4 class="pull-right" style="margin-bottom: 10px;margin-right: 50%;">装配外购件信息</h4>
            <form id="buyForm" class="form-horizontal">
                <table class="t1 t3">
                    <thead>
                    <tr>
                        <td style="width: 4%">序号</td>
                        <td style="width: 25%">物料名称</td>
                        <td style="width: 13%">跟踪号</td>
                        <td style="width: 7%">使用数量</td>
                        <td style="width: 5%">单位</td>
                        <td style="width: 10%">回货状态</td>
                        <td>存放位置</td>
                        <td>备注</td>
                        <td></td>
                    </tr>
                    </thead>
                    <tbody id="out">
                    <tr th:each="d : ${buyList}">
                        <td th:text="${dStat.count}"></td>
                        <td th:text="${d.matNameDesc}"></td>
                        <td th:text="${d.trackCode}"></td>
                        <td th:text="${d.useNum}"></td>
                        <td th:text="${d.unit}"></td>
                        <td th:text="${d.backStatus}"></td>
                        <td th:text="${d.position}"></td>
                        <td th:text="${d.comment}"></td>
                        <td></td>
                    </tr>
                    </tbody>
                </table>
            </form>
        </div>
    </div>
</section>
<div th:include="include :: footer"></div>
<script th:inline="javascript">

    let gloDeptName = toUtf8([[${asse.prodNo}]] + '|' + [[${asse.drawNo}]] + '|' + [[${asse.partId}]] + '|2');

    $("#qrCode-div").qrcode({
        width: 80,
        height: 80,
        text: gloDeptName
    });

    $(function () {

        let c = document.getElementsByTagName('canvas')[0];
        $("#qr-img").attr("src", c.toDataURL("image/png"));
    })

</script>
</body>
</html>
